Most of existing Nandflash reading/writing drivers are set up to accommodate a common file system, for example, support an almost unlimited number of files to be written into a memory, and a file reading/writing format is also a preparation format, and thus such file system drivers often require more hardware and software resources. For instance, a Linux operating system with a YAFFS file system is a well-known, excellent file system capable of perfectly supporting a Nandflash memory. Porting this system requires that a capacity of a RAM is usually one percent of that of the memory. For example, the capacity of the Nandflash memory is 1 GB, the required capacity of the RAM is 10 MB. In addition, a powerful CPU is also required, or else cannot meet requirements for file reading/writing speeds.
There is a class of application systems composed of embedded systems, such as long-term data acquiring and recording instruments, which are long in running time, less in files, and large in capacity of a single file when being started up. Resources of this class of systems are relatively stressed. For instance, the running speed of the CPU reaches tens of MHz, and the capacity of the RAM reaches tens or hundreds of KB. As a result, common standard file drive systems such as a YAFFS may not be ported. A large-capacity data recording system typically uses a NandFlash as a data memory. This memory is subjected to a writing operation with a block as a basic unit, and has a disadvantage of limited number of writing operations, such as 5000 times to 10000 times. At the time of delivery, there may be bad blocks that have already been marked (other blocks of the memory with bad blocks can be still subjected to writing and reading operations), and new bad blocks may be generated in a writing process. Accordingly, when such a memory is read/written, it is necessary to identify the bad block, avoid the bad block, and equalize the writing operations (as much as possible to ensure that all the blocks are consistent in number of the writing operations) to ensure the lifetime of the entire memory.
People have designed a variety of file systems to support reading and writing of the NandFlash, a basic idea of which is to create a mapping table and a data buffer, regularly update a record of the number of the writing operations and a record of bad blocks, and in this way, adjust a position of a block where data is written. When data starts to be written, the data is buffered in the buffer, and then written into the NandFlash after the preceding determination is completed.